<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <title>登陆</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0,user-scalable=no">
    <meta name="keywords" content=""/>
    <meta name="description" content=""/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <link rel="stylesheet" href="css/cui.css"/>
    <link rel="stylesheet" href="css/lib.css"/>
    <link rel="stylesheet" href="css/style.css"/>
</head>
<body style="background: #fff;">


<!-- 主内容 -->
<section id="bd">
    <form action="">
        <div class="m-login">
            <h3>用 户 登 录</h3>
            <div class="inp"><input v-model="user.phone" type="text" placeholder="请输入手机号"></div>
            <div class="inp"><input v-model="user.password" type="password" placeholder="请输入密码"></div>
            <p class="p-forget"><a href="reset-password.html">忘记密码？</a></p>
            <input class="m-btn3" @click.prevent="login" type="submit"  value="登　陆">
            <a class="m-btn3 m-btn3-1" href="register.html">新 用 户 注 册</a>
        </div>
    </form>
</section>
<!-- 主内容 end-->


<!-- 弹出框:失败 -->
<div class="m-pop dn" id="sub-f">
    <div class="pop-bg"></div>
    <div class="inner">
        <p>账号或密码错误</p>
        <p>请重新提交</p>
    </div>
</div>
<!-- 弹出框:失败 end-->
<script src="http://cdn.bootcss.com/jquery/1.11.3/jquery.min.js"></script>
<script type="text/javascript" src="js/lib.js"></script>
<script src="http://cdn.bootcss.com/vue/2.2.6/vue.min.js"></script>
<script src="http://cdn.bootcss.com/axios/0.15.3/axios.min.js"></script>
<script src="js/axios-config.js"></script>
<script>
    var form=new Vue({
       el:'form',
       data:{
           user:{
               phone:'15236101719',
               password:'123456'
           }
       },
       methods:{
           login:function () {
               var _=this;
               axios.student('login',_.user)
                   .then(function (res) {
                       if(res.data.Code===0){
                           if(location.href.indexOf('refer=')!==-1){
                               location.href=location.href.split('refer=')[1]
                           }else{
                               location.href="self.html"
                           }
                       }else if(res.data.Code===1){
                           $('.m-pop,.pop-bg').show()
                       }
                   })
           }
       }
   })
</script>


</body>
</html>